package br.com.fachada;

import br.com.excecoes.ClienteException;
import br.com.logica.ClienteBusiness;
import br.com.logica.ClienteBusinessImpl;
import br.com.modelo.Cliente;
import java.util.List;

/**
 *
 * @author Gernan
 */
public class FachadaImpl implements Fachada {
    
    private ClienteBusiness clienteBusiness;
    
    public FachadaImpl() {
        this.clienteBusiness = new ClienteBusinessImpl();
    }

    @Override
    public Cliente salvarCliente(Cliente cliente) throws ClienteException {
        return clienteBusiness.salvar(cliente);
    }

    @Override
    public Cliente atualizarCliente(Cliente cliente) throws ClienteException {
        return clienteBusiness.atualizar(cliente);
    }

    @Override
    public Cliente removerCliente(Cliente cliente) throws ClienteException {
        return clienteBusiness.remover(cliente);
    }

    @Override
    public Cliente getClientePorId(Long id) throws ClienteException {
        return clienteBusiness.getPorId(id);
    }

    @Override
    public Cliente getClientePorCpf(String cpf) throws ClienteException {
        return clienteBusiness.getPorCpf(cpf);
    }

    @Override
    public List<Cliente> buscar(String busca) throws ClienteException {
        return clienteBusiness.buscar(busca);
    }
    
    @Override
    public List<Cliente> getTodosClientes() throws ClienteException {
        return clienteBusiness.getTodos();
    }
    
    
    
}
